<?php

$oRoute				= new Yapary_Route_Route($oSql);
$oStaticRouteInstall= new Yapary_Route_StaticRouteInstall($oSql);
$oDynamicRouteInstall= new Yapary_Route_DynamicRouteInstall($oSql);

$relPath = ''; // Bei Bedarf, kann hier der zu verwendende Pfad noch angepasst werden




switch ($action) { // action wird von install.php uebergeben
	case 'routeInstall':
		$oStaticRouteInstall->install();
		$oDynamicRouteInstall->install();
		
		// MainMenu
		//								   |RouteName				   |ControllerName|ActionName	   |ActionViewName
		$oRoute->getStaticRouteList()->add('INDEX_INDEX', $relPath.'', 'Index_Index', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('CATALOG_INDEX', $relPath.'catalog', 'Catalog_Index', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('ACCOUNT_INDEX', $relPath.'account', 'Account_Index', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('ACCOUNT_MYDATA', $relPath.'account/my_data', 'Account_MyData', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('ACCOUNT_ORDER', $relPath.'account/order', 'Account_Order', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('ACCOUNT_PDF', $relPath.'account/pdf', 'Account_Pdf', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('ACCOUNT_PDFEDIT', $relPath.'account/pdf/edit', 'Account_PdfEdit', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('BASKET_INDEX', $relPath.'basket', 'Basket_Index', 'defaultAction', 'defaultView');

		$oRoute->getDynamicRouteList()->add('CATALOG_ENTRY', '/catalog\/product_([0-9]{1,5})$/', 'catalog/product', 'Catalog_Entry', 'defaultAction', 'defaultView');

		// FooterMenu
		$oRoute->getStaticRouteList()->add('INDEX_IMPRESSUM', $relPath.'impressum', 'Index_Impressum', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('INDEX_ABOUTUS', $relPath.'about_us', 'Index_AboutUs', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('INDEX_DATENSCHUTZ', $relPath.'datenschutz', 'Index_Datenschutz', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('INDEX_AGB', $relPath.'agb', 'Index_Agb', 'defaultAction', 'defaultView');

		// Others
		$oRoute->getStaticRouteList()->add('INDEX_REGISTER', $relPath.'register', 'Index_Register', 'defaultAction', 'defaultView');
		$oRoute->getStaticRouteList()->add('INDEX_LOGIN', $relPath.'login', 'Index_Login', 'defaultAction', 'defaultView');

		break;
	case 'routeUninstall':
		$oStaticRouteInstall->uninstall();
		$oDynamicRouteInstall->uninstall();
		break;
}


